home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
8bitfiles.net/archives
/
archives.tar
/
archives
/
compuserve-file-archive
/
02 Help & Utilities
/
FILUTI.BIN
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2019-04-13
|
8KB
|
219 lines
5 POKE56,40:POKE55,.:CLR:GOTO2010
10 Z$=CHR$(.):AS=51200:PE=51456:U1=51712:PRINT"[147][142]"
11 SYS49427:SYS50299:BC=.:X$="0123456789[193][194][195][196][197][198]":Q$=CHR$(34):POKE176,.:POKE177,.
12 PRINT"ENTER DISK DRIVE DEVICE NUMBER."
13 PRINT"(ENTER 0 TO EXIT.)"
14 PRINT" 8[145]":INPUTD:IFD=.THEN68
15 IFD<4ORD>30THENPRINT"[147]ILLEGAL DEVICE NUMBER":GOTO12
16 POKE2,36:POKE184,8:POKE185,.:POKE186,D
17 POKE183,1:POKE187,2:POKE188,.:SYS65472
18 IFPEEK(783)AND1THENCLOSE8:PRINT"[147]?DEVICE";D;"[157] NOT PRESENT":GOTO12
19 CLOSE8:OPEN15,D,15:PRINT"[147]";
20 PRINT"ENTER FILENAME (PRESS RETURN TO EXIT)."
25 F$="":PRINT:INPUTF$:IFF$=""THEN68
26 OPEN8,D,8,F$:GOSUB550:IFFTHENCLOSE8:GOTO20
27 PRINT"PRESS P TO PROCESS FILE."
28 PRINT"PRESS C TO CHECK FILE FIRST."
29 GETA$:IFA$="P"THEN32
30 IFA$="C"THEN1000
31 GOTO29
32 GOSUB500:CLOSE8:OPEN8,D,8,"#":PRINT#15,"U1";8;0;18;S
35 PRINT#15,"B-P";8;P+28
37 GET#8,A$:GET#8,B$:A=ASC(A$+Z$):B=ASC(B$+Z$)
38 NB=A+256*B:POKE158,A:POKE159,B
40 PRINT#15,"B-P";8;P+1
45 GET#8,A$:GET#8,B$:TT=ASC(A$+Z$):SS=ASC(B$+Z$)
50 POKEU1,TT:POKEU1+1,SS
55 CLOSE8:OPEN8,D,0,"$$":FORI=1TO34:GET#8,A$:NEXT
56 GET#8,A$:GET#8,B$:NF=ASC(A$+Z$)+256*ASC(B$+Z$)
57 CLOSE8
58 PRINT"FILE CONTAINS";NB;"BLOCKS."
59 PRINT"THERE ARE";NF;"FREE BLOCKS ON DISK."
61 IFNB>NFTHEN71
62 PRINT"DO YOU WANT A COPY OF THE FILE (Y/N)?"
63 GETA$:IFA$="Y"THEN85
64 IFA$="N"THEN100
65 GOTO63
68 CLOSE8:CLOSE15:POKE56,160:END
71 PRINT"(INSUFFICIENT ROOM FOR COPY OF FILE)"
72 PRINT"DO YOU WANT TO PROCEED (Y/N)?"
73 GETA$:IFA$="Y"THEN100
74 IFA$="N"THEN68
75 GOTO73
85 PRINT"ENTER FILENAME FOR COPY."
87 FC$="":PRINT:INPUTFC$:IFFC$=""THEN85
90 PRINT#15,"C0:";FC$;"=";F$
92 PRINT"ONE MOMENT PLEASE..."
95 GOSUB550:IFFTHEN85
100 F1=.:PRINT"[147]IS FILE IN ASCII OR PETASCII (A/P)?"
105 GETA$:IFA$="A"THEN140
110 IFA$="P"THEN120
115 GOTO105
120 POKE2,130:PRINT"CONVERT TO ASCII (Y/N)?"
125 GETA$:IFA$="Y"THENGOSUB800:GOTO157
130 IFA$="N"THEN160
135 GOTO125
140 POKE2,128:PRINT"CONVERT TO PETASCII (Y/N)?"
145 GETA$:IFA$="Y"THENGOSUB600:GOTO157
150 IFA$="N"THEN160
155 GOTO145
157 POKE2,PEEK(2)OR1:F1=1
160 PRINT"DO YOU WANT A LINEFEED AFTER"
162 PRINT"EACH CARRIAGE RETURN (Y/N)?"
165 GETA$:IFA$="Y"THENPOKE2,PEEK(2)OR64:GOTO180
170 IFA$="N"THEN180
175 GOTO165
180 IFF1THEN200
181 PRINT"DO YOU WANT TO REMOVE ALL CONTROL"
182 PRINT"CHARACTERS, OTHER THAN BACKSPACES, CR'S,"
183 PRINT"LF'S, CONTROL G'S, AND DELETES (Y/N)?"
185 GETA$:IFA$="Y"THENPOKE2,PEEK(2)AND127:GOTO200
190 IFA$="N"THEN200
195 GOTO185
200 PRINT"[147]ONE MOMENT PLEASE..."
202 PRINT"BLOCKS IN ORIGINAL FILE =";NB
203 PRINT"BLOCKS IN PROCESSED FILE = 0"
205 OPEN8,D,8,"#"
210 PRINT#15,"U1";8;0;TT;SS
212 SYS49152
215 SYS50006
250 IFPEEK(781)=.THEN289
260 IFPEEK(783)AND1THENPRINT:GOTO287
270 PRINT#15,"U1";8;0;18;S
272 L=PEEK(176):H=PEEK(177)
273 PRINT#15,"B-P";8;P+28
275 PRINT#8,CHR$(L);:PRINT#8,CHR$(H);
277 PRINT#15,"U2";8;0;18;S
280 PRINT:PRINT"PROCESSED FILE CONTAINS FEWER BLOCKS."
282 PRINT"VALIDATING TO FREE UNUSED BLOCKS..."
285 PRINT#15,"V0:":GOSUB550
287 PRINT"...DONE.":POKE56334,17:CLOSE8:CLOSE15:GOTO11
289 CLOSE8:OPEN8,D,8,F$+",A"
290 PRINT:PRINT"PROCESSED FILE CONTAINS MORE BLOCKS."
291 PRINT"APPENDING ADDITIONAL DATA...[145][145][145][145]"
292 BC=PEEK(176)+256*PEEK(177)
293 SYS49940:BC=BC+1:POKE154,3:PRINT,,"[145] "
294 PRINT,,"[145]";BC
295 IFPEEK(781)=.THEN293
298 PRINT"":GOTO287
300 Z%=Z/16+1:ZL=(ZAND15)+1
310 H$="$"+MID$(X$,Z%,1)+MID$(X$,ZL,1)
320 RETURN
400 M=256:F=.:N=.:A=.:IFASC(A$)=36THEN415
405 A=VAL(A$):IFA<.ORA>255THEN445
410 RETURN
415 B=ASC(RIGHT$(A$,N+1))AND127:IFB>70THEN445
420 IFB=36THEN440
425 RESTORE:B=B-47:FORI=.TOB:READY:NEXT
430 IFY<0THEN445
435 A=A+Y*16^N:N=N+1:GOTO415
440 IFA<MTHENRETURN
445 F=1:RETURN
490 DATA-1,0,1,2,3,4,5,6,7,8,9,-1,-1,-1
495 DATA-1,-1,-1,-1,10,11,12,13,14,15
500 PRINT#15,"M-R";CHR$(144);CHR$(2);CHR$(5)
510 GET#15,A$:S=ASC(A$+Z$):GET#15,A$:GET#15,A$
520 GET#15,A$:GET#15,A$:P=ASC(A$+Z$)
530 RETURN
550 INPUT#15,A,B$,C,E
560 F=.:IFA>19THENPRINT"[147]";A:PRINT:PRINTB$:PRINT:PRINTC,E:F=1
570 RETURN
600 PRINT"[147][193] STANDARD [193][211][195][201][201] TO [208][197][212][193][211][195][201][201] DEFAULT"
605 PRINT"TRANSLATION TABLE IS USED, BUT YOU MAY"
610 PRINT"WISH TO CHANGE SOME ENTRIES, SUCH AS"
615 PRINT"92, 95, 96, 123, 124, 125, AND 126."
620 PRINT"[212]O DISPLAY THE [208][197][212][193][211][195][201][201] EQUIVALENT OF AN"
625 PRINT"[193][211][195][201][201] VALUE, TYPE IN THE VALUE AND PRESS"
630 PRINT"[210][197][212][213][210][206]. [208]RECEDE THE VALUE WITH A $ FOR"
635 PRINT"HEXADECIMAL ENTRY. [201]F THE TABLE IS"
640 PRINT"SATIFACTORY, BEFORE OR AFTER MAKING"
645 PRINT"CHANGES, JUST PRESS [210][197][212][213][210][206] TO PROCEED."
646 PRINT" [[208][210][197][211][211] [210][197][212][213][210][206]]";
647 GETA$:IFA$=CHR$(13)THEN650
648 GOTO647
650 PRINT"[147][201]F THE [208][197][212][193][211][195][201][201] VALUE IS ACCEPTABLE,"
655 PRINT"JUST PRESS [210][197][212][213][210][206]. [207]THERWISE, ENTER A"
660 PRINT"NEW VALUE. [197]NTERING R AT ANY PROMPT"
665 PRINT"WILL RESET TO THE DEFAULT TABLE."
670 PRINT" [[208][210][197][211][211] [210][197][212][213][210][206]]";
673 GETA$:IFA$=CHR$(13)THENPRINT"[147]":GOTO680
675 GOTO673
680 PRINT" [197][206][212][197][210] R [212][207] [210][197][211][197][212] [212][207] [196][197][198][193][213][204][212] [212][193][194][204][197]"
681 PRINT" [163][163][163][163][163] [163] [163][163] [163][163][163][163][163] [163][163] [163][163][163][163][163][163][163] [163][163][163][163][163]"
682 PRINT"[197][206][212][197][210] [193][211][195][201][201] [214][193][204][213][197]."
683 PRINT"([201][198] [212][193][194][204][197] [207][203], [208][210][197][211][211] [210][197][212][213][210][206] [212][207] [208][210][207][195][197][197][196].)"
685 A$="":PRINT:INPUTA$:IFASC(A$+Z$)=82THENSYS49427:PRINT"[147][210][197][211][197][212]":GOTO680
687 IFA$=""THENPRINT"[147][142]";:RETURN
690 GOSUB400:IFA>127ORFTHENPRINT"[147][201][204][204][197][199][193][204] [197][206][212][210][217]":GOTO680
692 B=A:Z=PEEK(B+AS):GOSUB300
693 J$="":IFZ>31ANDZ<128ORZ>159THENJ$=" = "+Q$+CHR$(Z)+Q$
695 PRINT"[208][197][212][193][211][195][201][201] [214][193][204][213][197] =";Z;" = ";H$;J$
697 A$=MID$(STR$(Z),2)
700 PRINT"[197][206][212][197][210] [206][197][215] [208][197][212][193][211][195][201][201] [214][193][204][213][197]."
705 PRINT"([207][210] [208][210][197][211][211] [210][197][212][213][210][206] [198][207][210] [206][207] [195][200][193][206][199][197].)"
710 PRINT:INPUTA$:IFASC(A$+Z$)=82THENSYS49427:PRINT"[210][197][211][197][212]":GOTO692
715 GOSUB400:IFFTHENPRINT"[201][204][204][197][199][193][204] [197][206][212][210][217]":GOTO697
720 POKEAS+B,A:PRINT"[147]":GOTO680
800 PRINT"[147][193] STANDARD [208][197][212][193][211][195][201][201] TO [193][211][195][201][201] DEFAULT"
805 PRINT"TRANSLATION TABLE IS USED, BUT YOU MAY"
810 PRINT"WISH TO CHANGE SOME ENTRIES, SUCH AS"
815 PRINT"92, 95, 164, 186, 223, 221, AND 169."
820 PRINT"[212]O DISPLAY THE [193][211][195][201][201] EQUIVALENT OF A"
825 PRINT"[208][197][212][193][211][195][201][201] VALUE, TYPE IN THE VALUE AND"
830 PRINT"PRESS [210][197][212][213][210][206]. [208]RECEDE THE VALUE WITH A"
835 PRINT"$ FOR HEXADECIMAL ENTRY. [201]F THE TABLE"
840 PRINT"IS SATIFACTORY, BEFORE OR AFTER MAKING"
845 PRINT"CHANGES, JUST PRESS [210][197][212][213][210][206] TO PROCEED."
846 PRINT" [[208][210][197][211][211] [210][197][212][213][210][206]]";
847 GETA$:IFA$=CHR$(13)THEN850
848 GOTO847
850 PRINT"[147][201]F THE [208][197][212][193][211][195][201][201] VALUE IS ACCEPTABLE,"
855 PRINT"JUST PRESS [210][197][212][213][210][206]. [207]THERWISE, ENTER A"
860 PRINT"NEW VALUE. [197]NTERING R AT ANY PROMPT"
865 PRINT"WILL RESET TO THE DEFAULT TABLE."
870 PRINT" [[208][210][197][211][211] [210][197][212][213][210][206]]";
873 GETA$:IFA$=CHR$(13)THENPRINT"[147]":GOTO880
875 GOTO873
880 PRINT" [197][206][212][197][210] R [212][207] [210][197][211][197][212] [212][207] [196][197][198][193][213][204][212] [212][193][194][204][197]"
881 PRINT" [163][163][163][163][163] [163] [163][163] [163][163][163][163][163] [163][163] [163][163][163][163][163][163][163] [163][163][163][163][163]"
882 PRINT"[197][206][212][197][210] [208][197][212][193][211][195][201][201] [214][193][204][213][197]."
883 PRINT"([201][198] [212][193][194][204][197] [207][203], [208][210][197][211][211] [210][197][212][213][210][206] [212][207] [208][210][207][195][197][197][196].)"
885 A$="":PRINT:INPUTA$:IFASC(A$+Z$)=82THENSYS49427:PRINT"[147][210][197][211][197][212]":GOTO880
887 IFA$=""THENPRINT"[147][142]";:RETURN
890 GOSUB400:IFFTHENPRINT"[147][201][204][204][197][199][193][204] [197][206][212][210][217]":GOTO880
892 B=A:Z=PEEK(B+PE):GOSUB300
893 J$="":IFZ>31ANDZ<128ORZ>159THENJ$=" = "+Q$+CHR$(Z)+Q$
895 PRINT"[193][211][195][201][201] [214][193][204][213][197] =";Z;" = ";H$;J$
897 A$=MID$(STR$(Z),2)
900 PRINT"[197][206][212][197][210] [206][197][215] [193][211][195][201][201] [214][193][204][213][197]."
905 PRINT"([207][210] [208][210][197][211][211] [210][197][212][213][210][206] [198][207][210] [206][207] [195][200][193][206][199][197].)"
910 PRINT:INPUTA$:IFASC(A$+Z$)=82THENSYS49427:PRINT"[210][197][211][197][212]":GOTO892
915 GOSUB400:IFA>127ORFTHENPRINT"[201][204][204][197][199][193][204] [197][206][212][210][217]":GOTO897
920 POKEPE+B,A:PRINT"[147]":GOTO880
1000 PRINT"[147]PRESS F1 TO START PRINTING TO SCREEN."
1010 PRINT"PRESS F3 TO STOP PRINTING TO SCREEN."
1020 PRINT"PRESS CONTROL KEY TO SLOW SCROLLING."
1030 PRINT"PRESS RETURN WHEN FINISHED CHECKING."
1040 GETA$:IFA$=CHR$(133)THEN1120
1050 IFA$=CHR$(13)THEN1070
1060 GOTO1040
1070 PRINT"[147][142]PRESS P TO PROCESS FILE."
1080 PRINT"PRESS X TO EXIT."
1090 GETA$:IFA$="X"THEN68
1100 IFA$="P"THENCLOSE8:OPEN8,D,8,F$:GOTO32
1110 GOTO1090
1120 PRINT"[147]"
1130 SYS50240:IFPEEK(144)THEN1150
1140 PRINT"[154][146]";:GOTO1070
1150 PRINT:PRINT"[146][154] [197][206][196] [207][198] [198][201][204][197]"
1155 PRINT" [163][163][163] [163][163] [163][163][163][163]"
1160 PRINT"[208][210][197][211][211] [210][197][212][213][210][206]."
1170 GETA$:IFA$=CHR$(13)THEN1070
1180 GOTO1170
2010 PRINT"[147]ONE MOMENT PLEASE..."
2020 P=PEEK(45)+256*PEEK(46)-1
2030 IFPEEK(P)THENP=P-1:GOTO2030
2040 S=49152:P=P-1158
2050 FORI=.TO1158:POKES+I,PEEK(P+I):NEXT
2060 POKE2069,48:GOTO10